import React from 'react'
import {HashRouter as Router,Route,Switch} from 'react-router-dom';
import {PrivateRoute} from './private'
import App from '../App';
import ClassifyComponent from '../pages/goods/classify'
import LoginComponent from '../pages/login/login'
import RegComponent from '../pages/login/reg'
import ProfileComponent from '../pages/user/profile'
import PasswordComponent from '../pages/user/password'
import FavComponent from '../pages/user/fav'
import AddressComponent from '../pages/user/address'
import AddComponent from '../pages/user/add'
import ModComponent from '../pages/user/mod'
import AddresxComponent from '../pages/order/addresx'
import DetailsIndex from '../pages/goods/details/index'
import SearchComponent from '../pages/common/search'
import WordComponent from '../pages/common/word'
import OrderIndex from '../pages/order/index'
import EndComponent from '../pages/order/end'
import IndexComponent from '../pages/user/order/index'

export default class RouterComponent extends React.Component{
    render() {
        return(
            <React.Fragment>
                <Router>
                    <React.Fragment>
                        <Switch>
                            <Route exact path="/" component={App}></Route>
                            <Route path="/goods/classify" component={ClassifyComponent}/>
                            <Route path="/login/login" component={LoginComponent}/>
                            <Route path="/login/reg" component={RegComponent}/>
                            <Route path="/goods/details" component={DetailsIndex}/>
                            <Route path="/common/search" component={SearchComponent}/>
                            <Route path="/common/word" component={WordComponent}/>
                            <PrivateRoute path="/user/profile" component={ProfileComponent}></PrivateRoute>
                            <PrivateRoute path="/user/password" component={PasswordComponent}></PrivateRoute>
                            <PrivateRoute path="/user/fav" component={FavComponent}></PrivateRoute>
                            <PrivateRoute path="/user/address" component={AddressComponent}></PrivateRoute>
                            <PrivateRoute path="/user/add" component={AddComponent}></PrivateRoute>
                            <PrivateRoute path="/user/mod" component={ModComponent}></PrivateRoute>
                            <PrivateRoute path="/order/index" component={OrderIndex}></PrivateRoute>
                            <PrivateRoute path="/order/end" component={EndComponent}></PrivateRoute>
                            <PrivateRoute path="/user/order" component={IndexComponent}></PrivateRoute>
                            <PrivateRoute path="/order/addresx" component={AddresxComponent}></PrivateRoute>
                        </Switch>
                    </React.Fragment>
                </Router>
            </React.Fragment>
        )
    }
}